<%@page import="qingke.mybatis.pojo.Store"%>
<%@page import="qingke.mybatis.pojo.Product"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.Iterator"%>
<%@page import="qingke.mybatis.pojo.User"%>
<%@page import="java.util.List"%>
<%@page import="qingke.bean.CartOfProduct"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="${pageContext.request.contextPath }/css/personalcenter.css"
	type="text/css" rel="stylesheet" />
<link href="${pageContext.request.contextPath }/css/bootstrap.min.css"
	type="text/css" rel="stylesheet" />
<script src="${pageContext.request.contextPath }/js/jquery-1.8.3.min.js"></script>
<script src="${pageContext.request.contextPath }/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath }/js/personal.js"></script>
</head>
<%
	Object myStoreObject = session.getAttribute("Mystore");
	List<Store> myStore = null;
	if (myStoreObject != null) {
		if (myStoreObject instanceof List) {
			myStore = (List) myStoreObject;
		}
	}
%>
<body>
	<div class="person-content-location">
		<a href="" role="button">当前位置</a> > <a href="" role="button">个人中心</a>
		> <a href="" role="button">我的店铺</a>
	</div>
	<hr />
	<div>
		<%
			if (myStore.size() > 0) {
		%>

		<%
			for (Store store : myStore) {
		%>
		<%
			if (store != null) {
		%>
		<div class="panel-group" id="accordion<%=store.getStoreId()%>">
			<div class="panel panel-default">
				<div class="panel-heading" style="background: #1ea2b0">
					<h4 class="panel-title">
						<a data-toggle="collapse"
							data-parent="#accordion<%=store.getId()%>"
							href="#collapseOne<%=store.getId()%>"><%=store.getStoreName()%></a>
						<select id="useraddress<%=store.getId()%>"
							name="useraddress<%=store.getId()%>"
							onchange="changestorestatus('useraddress',<%=store.getId()%>)">
							<%
								if (-1 == store.getStoreStatus()) {
							%>
							<option value="-1" selected="selected">店铺审核中</option>
							<%
								} else {
							%>
							<option value="0" <%if (0 == store.getStoreStatus()) {%>
								selected="selected" <%}%>>开店</option>
							<option value="1" <%if (1 == store.getStoreStatus()) {%>
								selected="selected" <%}%>>暂停营业</option>
							<%
								}
							%>
						</select>
						<button style="float: right; background: #1ea2b0; border: 0px"
							onclick="modify('accordion<%=store.getStoreId()%>')">修改</button>
					</h4>
				</div>
				<div id="collapseOne<%=store.getId()%>"
					class="panel-collapse collapse in">
					<div class="panel-body">
						<form id="basemessage" action="Store/updateStore" class="store">
							<div style="display: none">
								<label for="id">店铺id:</label><input id="id" name="id"
									value="<%=store.getId()%>" disabled="disabled" />
							</div>
							<div>
								<label for="storeAddress">店铺地址:</label><input id="storeAddress"
									name="storeAddress" value="<%=store.getStoreAddress()%>"
									disabled="disabled" />
							</div>
							<div>
								<label for="storetel">店铺电话 ： </label><input id="storetel"
									name="storetel" value="<%=store.getStoreTel()%>"
									disabled="disabled" />
							</div>
							<div>
								<label for="storeCreattime">店铺创建时间 ：<%=store.getStoreCreattime()%>
								</label>
							</div>
							<button type="submit" style="float: right; display: none">提交</button>

						</form>
						<%
							}
						%>
					</div>
				</div>
			</div>
		</div>
		<%
			}
		%>
		<a href="OpenStore.jsp">我要开店</a>
		<%
			} else {
		%>
		<h1>
			你还有没有注册过店铺
			<hr />
			<a href="OpenStore.jsp">我要开店</a>
		</h1>
		<%
			}
		%>
	</div>
</body>
</html>